package svc

import (
	"gitee.com/HongXuandaozun/ptwo/internal/config"
	"gitee.com/HongXuandaozun/ptwo/pone"
	"github.com/zeromicro/go-zero/zrpc"
)

type ServiceContext struct {
	Config     config.Config
	PoneClient pone.PoneClient
}

func NewServiceContext(c config.Config) *ServiceContext {
	rpc := zrpc.MustNewClient(zrpc.RpcClientConf{Etcd: c.UserRpc.Etcd})

	return &ServiceContext{
		Config:     c,
		PoneClient: pone.NewPoneClient(rpc.Conn()),
	}
}
